using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;

namespace WpfApp1.ViewModels;

public partial class TabItemViewModel : ObservableObject
{
    [ObservableProperty]
    private string _header;

    [ObservableProperty]
    private string _content;

    [RelayCommand]
    private void Close()
    {
        if (CloseRequested != null)
        {
            CloseRequested(this);
        }
    }

    public delegate void CloseRequestedHandler(TabItemViewModel viewModel);
    public event CloseRequestedHandler CloseRequested;

    public TabItemViewModel(string header, string content)
    {
        Header = header;
        Content = content;
    }
}
